package myjava.processi;

public class Root {

   public static void main(String[] args) {

      Runnable runner = new Foo();

      Thread t1 = new Thread(runner, "Fabs");
      Thread t2 = new Thread(runner, "Laurent");
      Thread t3 = new Thread(runner, "Giggggi");
      t1.start();
      t2.start();
      t3.start();
   }
}

class Foo implements Runnable {

   private static boolean MAKEITSLEEP = true;

   public void run() {
      for (int i = 0; i < 100; i++) {
         System.out.println("hello I am " + Thread.currentThread().getName() + " - iteration " + i);
         if (MAKEITSLEEP) {
            try {
               Thread.sleep(100);
            } catch (InterruptedException ex) {
               ;
            }
         }
         // System.out.println("hello I am " + Thread.currentThread().getName() + " (AFTER SLEEP) - iteration " + i);
      }
   }
}